<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:U('indexlinks/links_list')}">分销用户列表</a></li>
			<li class="active"><a>添加终端</a></li>
		</ul>
        <form class="form-horizontal js-ajax-forms" action="" method="post">
			<fieldset>
				<div class="tabbable">
					<div class="tab-content">
							<fieldset>
								<div class="control-group">
									<label class="control-label">终端名称</label>
									<div class="controls">
										<input type="text" value="" name='options[name]'>
									</div>
								</div>
								
								<div class="control-group">
									<label class="control-label"></label>
									<div class="controls">
										<button type='button' class="btn btn-primary" onclick='zd()'>点击生成终端号码</button>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">终端号码:</label>
									<div class="controls">
										<input type="text" name='options[code]' style='width:300px' id='code' value="">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">关联分销渠道:</label>
									<div class="controls">
										<select name="options[user]">
											<foreach name="list" item="vo">
											<option value="{$vo.id}">{$vo.user_login}</option>
											</foreach>
										</select>
									</div>
								</div>
							</fieldset>
					</div>
				</div>

				<div class="form-actions">
					<button type="submit" class="btn btn-primary  js-ajax-submit">添加</button>
				</div>
			</fieldset>
		</form>
		
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
</body>
<script>
function zd(){
	len = 5;
　　var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyzoOLlgqVvUuI';
　　var maxPos = $chars.length;
　　var pwd = '';
　　for (i = 0; i < len; i++) {
　　　　pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
　　}
	$('#code').val(pwd);
}
</script>
</html>